#pragma once
#include "SingletonBase.h"

struct FilterType
{
	enum Enum
	{
		Unknown = 0,
		ProcessName,
		
	};
};

class HotKeyManager : public SingletonBase<HotKeyManager>
{
public:
	struct HotKeyLink;

	HotKeyManager(void);
	~HotKeyManager(void);
	void SetHwnd(HWND val) { mHwnd = val; }

	void SaveAllHotKey();
	void LoadAllHotKey();

	bool AddHotKey(FilterType::Enum filterType, std::wstring name, UINT modKey, UINT vKey, bool needSave);
	const HotKeyLink* GetHotKey(ATOM atom) const;

	ATOM RegHotKey(UINT modKey, UINT vKey);
	bool UnRegHoKey(ATOM atom);
	void InitHotKeyMap();
	bool CheckUnRegHotKey(HotKeyLink& hotKeyLink);
	CString ToCString(TCHAR t);
	CString GetKeyString(UINT key)
	{
		std::map<UINT, CString>::iterator it = mVKeyMap.find(key);
		return it != mVKeyMap.end() ? it->second : CString();
	}

	struct HotKeyLink
	{
		bool mNeedSave;
		FilterType::Enum mFilterType;
		std::wstring mName;
		UINT mModKey;
		UINT mVKey;
	};
	typedef std::map<ATOM, HotKeyLink> HotKeyLinkMap;

	HotKeyLinkMap mHotKeyLinkMap;
	std::list<HotKeyLink> mUnRegHotKeyLinks;

	std::map<UINT, CString> mVKeyMap;


	HWND mHwnd;
};
